package org.example.factory.simple.abs.impl;

import org.example.factory.simple.abs.AbsFactory;
import org.example.factory.simple.abs.BJCheesePizza3;
import org.example.factory.simple.abs.BJPepperPizza3;
import org.example.factory.simple.abs.Pizza3;

/**
 * @author wf
 * @description 工厂实现
 */

public class BJFactoryImpl implements AbsFactory {
    @Override
    public Pizza3 createPizza3(String orderType) {
        System.out.println("~使用BJ抽象工厂模式~");
        Pizza3 pizza = null;
        if (orderType.equals("cheese")){
            pizza = new BJCheesePizza3();
        }else if (orderType.equals("pepper")){
            pizza = new BJPepperPizza3();
        }
        return pizza;
    }
}
